package day05;
import java.util.Arrays;
import java.util.Scanner;

public class homework {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        /**int score=0;
         for (int i = 1; i <= 10; i++) {
         int a = (int) (Math.random() * 100);
         int b = (int) (Math.random() * 100);
         int result = a + b;
         System.out.println("(" + i + ")" + a + "+" + b + "=" + "?");
         System.out.println("算吧");
         int answer = scanner.nextInt();

         if (answer == result) {
         System.out.println("恭喜你答对了");
         score+=10;

         } else {
         System.out.println("答错了");
         }
         }
         System.out.println("总分为："+score);*/

        for (int num = 1; num <= 9; num++) {
            for (int i = 1; i <= num; i++) {

                System.out.print(i + "*" + num + "=" + i * num + "\t");
            }
            System.out.println("");//换行·
        }

       /* int[] arr= new int[2];

        int[] arr1=new int[3];
        int[] arr2=new int[]{1,2,3,4};
        int[] arr3={1,2,3,3};*/

        int[] arr = new int[3];
        System.out.println(arr.length);
        arr[0] = 100;
        arr[1] = 123;
        arr[2] = 145;
        //arr[3]=125; 数组下标越界
        System.out.println(arr[arr.length - 1]);


        int[] arr1 = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr1[i] = (int) (Math.random() * 100);
            System.out.println(arr1[i]);
        }

        int max = arr1[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[0] > arr[i]) {
                max = arr[i];
            }
        }
        System.out.println(max);

        int[] arr2={1,2,3,4,5};
        Arrays.sort(arr2);
        for (int i = 0; i <arr2.length ; i++) {
            System.out.println(arr2[i]);
        }

    }


}
